/**
 * 
 */
package org.t2.game.server.module.player.message;

import org.t2.game.server.foundation.player.PlayerContext;
import org.t2.game.server.foundation.player.PlayerInternalMessage;

import pb.t2.protobuf.player.Player.PlayerLoginRequest;

/**
 * @author YY
 */
public class PlayerLoginMessage implements PlayerInternalMessage {
	private PlayerContext playerContext;
	private PlayerLoginRequest request;
	//是否创号登录
	private boolean create;
	
	public static PlayerLoginMessage of(PlayerContext playerContext, PlayerLoginRequest request, boolean create) {
		PlayerLoginMessage message = new PlayerLoginMessage();
		message.playerContext = playerContext;
		message.request = request;
		message.create = create;
		return message;
	}

	public PlayerContext getPlayerContext() {
		return playerContext;
	}

	@Override
	public long getPlayerId() {
		return playerContext.getId();
	}

	public PlayerLoginRequest getRequest() {
		return request;
	}

	public boolean isCreate() {
		return create;
	}
}
